﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataModel.Core
{
    public class Settings
    {
        private static Settings _Current;
        public static Settings Current
        {
            get
            {
                if (_Current == null)
                {
                    _Current = new Settings() { IOC = new DefaultIOContainer(), UserSettings = new DefaultUserSettings() };
                }
                return _Current;
            }
            set
            {
                _Current = value;
            }
        }
        public IOContainer IOC { get; set; }
        public IUserSettings UserSettings { get; set; }
    }
    internal class DefaultIOContainer : IOContainer
    {
        public T Resolve<T>()
        {
            return Activator.CreateInstance<T>();
        }
    }
    internal class DefaultUserSettings : IUserSettings
    {

        public Models.InsuranceCompany MainCompany { get; set; }

        public string UserName
        {
            get
            {
                return "Default";
            }
        }

        public bool UseBlanks
        {
            get
            {
                return true;
            }
        }
    }
}
